package cn.itsource.ymcc.mapper;

import cn.itsource.ymcc.domain.Course;
import cn.itsource.ymcc.domain.Teacher;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zongchangjiang
 * @since 2023-03-31
 */
public interface CourseMapper extends BaseMapper<Course> {

    /**
     * @Param这个注解的作用就是告诉mybatis我这参数叫什么
     *
     * @param id
     * @param teacharIds
     */
    void insertCourseTeacher(@Param("id") Long id,@Param("tids") List<Long> teacharIds);

    List<Long> selectTeacherIdsByCourseId(Long id);

    void deleteByCourseId(Long id);

    List<Course> selectCourseByStatusAndIds(@Param("ids") List<Long> ids,@Param("status") Integer status);

    void onLineOrOffLineCourse(@Param("ids")List<Long> ids,@Param("status") Integer status);

    List<Teacher> selectTeacherByCourseId(Long courseId);
}
